using Circus.CodeEditor;
using Circus.CodeEditor.Serialization;
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace Circus.CodeEditor
{
	public class MacroKeyData : KeyData
	{
		private string fullName = string.Empty;
		private KeyEventType paramType = KeyEventType.None;
		private string paramStr = string.Empty;
		public KeyEventType ParamType
		{
			get
			{
				KeyEventType result;
				if (base.Param is int)
				{
					result = KeyEventType.IntParam;
				}
				else
				{
					if (base.Param is char)
					{
						result = KeyEventType.CharParam;
					}
					else
					{
						if (base.Param is SelectionType)
						{
							result = KeyEventType.SelectionParam;
						}
						else
						{
							result = this.paramType;
						}
					}
				}
				return result;
			}
			set
			{
				if (this.paramType != value)
				{
					this.paramType = value;
					this.OnParamTypeChanged();
				}
			}
		}
		public string ParamStr
		{
			get
			{
				return (base.Param != null) ? ((base.Param is char) ? ((int)((char)base.Param)).ToString() : base.Param.ToString()) : this.paramStr;
			}
			set
			{
				if (this.paramStr != value)
				{
					this.paramStr = value;
					this.OnParamStrChanged();
				}
			}
		}
		public string FullName
		{
			get
			{
				string result;
				if (base.Action != null)
				{
					result = base.Action.Target.GetType().Name + "." + base.Action.Method.Name;
				}
				else
				{
					if (base.ActionEx != null)
					{
						result = base.ActionEx.Target.GetType().Name + "." + base.ActionEx.Method.Name;
					}
					else
					{
						result = this.fullName;
					}
				}
				return result;
			}
			set
			{
				if (this.fullName != value)
				{
					this.fullName = value;
					this.OnFullNameChanged();
				}
			}
		}
		
		protected virtual void OnParamTypeChanged()
		{
		}
		protected virtual void OnParamStrChanged()
		{
		}
		protected virtual void OnFullNameChanged()
		{
		}
		public MacroKeyData(Keys keyData, KeyEvent action, KeyEventEx actionEx, object param, int state, int leaveState) : base(keyData, action, actionEx, param, state, leaveState)
		{
		}
		public MacroKeyData()
		{
		}
	}
}
